﻿Ext
		.define(
				"Lia.view.SearchCar",
				{
					extend : "Ext.form.Panel",
					requires : [ "Ext.form.FieldSet", "Ext.field.Select" ],
					id : 'SearchCar',
					alias : "widget.searchview",
					config : {
						scrollable : 'vertical',
						items : [
								{
									xtype : "toolbar",
									docked : "top",
									title : "Search Car",
									items : [ {
										xtype : "spacer"
									}, {
										xtype : "button",
										ui : "action",										
										iconCls: 'search', 
										iconMask: true,
										id : "searchBtnMain",
										itemId : "searchBtnMain"
									} ]
								},
								{
									xtype : "fieldset",
									items : [
											{
												xtype : 'selectfield',
												name : 'marca',
												usePicker: true,
												required:true,
												id : "selectMarca",
												label : 'Marca',
												valueField : 'namemarca',
												displayField : 'namemarca',
												store : 'StoreMarca',												
											},
											{
												xtype : 'selectfield',
												name : 'modelo',
												usePicker: true,
												required:true,
												label : 'Modelo',
												valueField : 'namemodelo',
												displayField : 'namemodelo',
												store : 'StoreModelo'
											},		
											{
				                                xtype: 'selectfield',
				                                name : 'color',				                               
				                                usePicker: true,	
				                                required:true,
				                                label: 'Color',
				                                options: [
													{
													    text : 'Todos',
													    value: 'Todos'
													},
													{
				                                        text : 'Amarillo',
				                                        value: 'amariblo'
				                                    },
				                                    {
				                                        text : 'Azul',
				                                        value: 'azul'
				                                    },
				                                    {
				                                        text : 'Blanco',
				                                        value: 'blanco'
				                                    },
				                                    
				                                    {
				                                        text : 'Gris',
				                                        value: 'gris'
				                                    },
				                                    {
				                                        text : 'Rojo',
				                                        value: 'rojo'
				                                    },
				                                    {
				                                        text : 'Negro',
				                                        value: 'negro'
				                                    },
				                                    {
				                                        text : 'Perlado',
				                                        value: 'perlado'
				                                    }
				                                ]
				                            },
											{
												xtype : "fieldset",
												title: 'Precio Mínimo',
									            //instructions: 'Seleccione cota inferior',
												items : [
															{
																xtype : 'sliderfield',
																name : 'precioMin',												
																listeners : {
																	change : function(slider,
																			thumb, newValue,
																			oldValue) {														
																		this.parent.items.items[1].setValue(formatCurrencyWithOutCent(slider.getValue()[0]));
																	}
																},
																//label : 'Precio',
																minValue : 0,
																increment: 1000,
																id : 'sliderPrecioMin',
																maxValue : 100000,
																value : 0
															},
															{
															    xtype         : 'textfield',				                               
															    //label         : 'Minimo',	
															    readOnly: true,
															    value: 0,
															    placeHolder   : 'Seleccione Minimo',
															    id:'textMin'
															    
															}
												         ]
											},											
											{
												xtype : "fieldset",
												title: 'Precio Maximo',
									            //instructions: 'Seleccione cota superior',
												items : [
															{
																xtype : 'sliderfield',
																name : 'precioMax',												
																listeners : {
																	change : function(slider,
																			thumb, newValue,
																			oldValue) 
																			{
																		this.parent.items.items[1].setValue(formatCurrencyWithOutCent(slider.getValue()[0]));
																	}
																},
																//label : 'Precio',
																minValue : 10000,
																increment: 1000,
																maxValue : 100000,
																value : 100000
															},
															{
															    xtype         : 'textfield',				                               
															    //label         : 'Maximo',
															    readOnly: true,
															    value: '100.000',
															    placeHolder   : 'Seleccione Maximo',
															    id:'textMax'
															    
															}
												         ]
											}
									]
								} ],

					}

				});
